<template>
	<el-card shadow="hover" :body-style="{ paddingBottom: '0' }" >
		<el-form  ref="queryForm" :inline="true">
			<el-form-item>
				<el-button round type="primary" icon="ele-Edit" @click="openUpdatesinglePage"> 修 改 </el-button>
			</el-form-item>
		</el-form>
	</el-card>
	<el-card class="full-table" shadow="hover" style="margin-top: 8px" >
		<div>
	<div style="color: cadetblue;">单页面模块，无需展示数据</div>
			 <el-divider border-style="double" />
			<el-form :model="state.row" ref="ruleFormRef" label-width="auto">
				<el-row>
					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="24" class="mb20">
						<el-form-item label="栏目名称" prop="title">
							<el-input v-model="state.row.title" readonly clearable />
						</el-form-item>
					</el-col>		
					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="24" class="mb20">
						<el-form-item label="副标题"  prop="subTitle" >
							<el-input v-model="state.row.subTitle" readonly clearable />
						</el-form-item>
					</el-col>
				</el-row>
				<el-row>
					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="24" class="mb20">
						<el-form-item label="是否显示" prop="isTopShow">
							 <el-switch
							    v-model="state.row.isTopShow"
							    inline-prompt
								disabled
								style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
							    active-text="是"
							    inactive-text="否"
							  />
						</el-form-item>
					</el-col>		
					<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="24" class="mb20">
						<el-form-item label="英文名称"  prop="enTitle" >
							<el-input v-model="state.row.enTitle" readonly clearable />
						</el-form-item>
					</el-col>
				</el-row>
			</el-form>
		</div>
	</el-card>
	<EditSinglePageTemp ref="singlePageTempRef" :title="state.editTitle" @handleQuery="handleQuery" />
</template>
<script lang="ts" setup name="singlePage">
import { onMounted, reactive, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import EditSinglePageTemp from '/@/views/CMS/cms_Template/common/singlePageTemp.vue';


// const baseUrl = window.__env__.VITE_API_URL;
const singlePageTempRef = ref<InstanceType<typeof EditSinglePageTemp>>();
const props = defineProps({
	isshow: false as any,
});
const state = reactive({
	editTitle:'',
	row:{} as any,
});
onMounted(async () => {
	
});
// 打开组件
const openUnit = (row: any) => {
	state.row=row;
	//ruleForm.value = JSON.parse(JSON.stringify(row));
};
//父级传递来的函数，用于回调
const emit = defineEmits(['handleQuery']);
// 查询操作
const handleQuery = async () => {
	emit('handleQuery');
};

//修改
const openUpdatesinglePage=async()=>{
	state.editTitle="修改栏目";
	singlePageTempRef.value?.openDialog(state.row);
};

//将属性或者函数暴露给父组件
defineExpose({ openUnit });
</script>
